/*
    This file is part of SQLiteGTK, written by Aly Hirani

    SQLiteGTK is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    SQLiteGTK is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with SQLiteGTK.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "about_dialog.h"
#include "include.h"

void
create_and_show_about_dialog (GtkWindow *parent)
{
	static gchar *authors[] = {"Aly Hirani", NULL};
	static gchar *license = NULL;

	D_ASSERT(parent != NULL);

	/* TODO: Add logo here */

	/* A standard that allows only a maximum of 509 characters in a static string. Are you fucking kidding me?! */
	if(license == NULL)
	{
		license = g_malloc(607);
		g_assert(license != NULL);

		sprintf(license, "%s%s", "SQLiteGTK is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nSQLiteGTK is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\nYou should have received a copy", " of the GNU General Public License along with SQLiteGTK.  If not, see <http://www.gnu.org/licenses/>.");
	}

	gtk_show_about_dialog(parent, "authors", authors, "comments", "A simple GTK+ GUI to SQLite", "copyright", 
		"Copyright(c) 2009 Aly Hirani", "program-name", "SQLiteGTK+", "version", SQLITEGTK_VERSION, "wrap-license", TRUE, "license",
		license, NULL);
}
